#ifndef __SERVER_CORE_H__
#define __SERVER_CORE_H__

#include "NetDef.h"
#include "xGUID.h"

struct xMSG;
class CMsgHandler;

class CServerCore
{
	SINGLETON_CLASS(CServerCore);
public:
	CServerCore();
	~CServerCore();

	void startNet();
	void LoadDB();

	void SendMsg2Server(std::string& ip_port, xMSG& msg);
	void SendMsg2Server(ENetDef::_eNet et, xMSG& msg);
	void SendMsg2Logic(U64 uGuid, xMSG& msg);
	void SendMsg2Net(U64 uGuid, xMSG& msg);

	S32 newTcpClient( ENetDef::_eNet remote_card, std::string remote_ip, U16 remote_port );

	BOOL ConConstruct();
	void Terminal();
protected:
	

protected:
	CMsgHandler*  handler;
};

#endif //__SERVER_CORE_H__